import request from '@/utils/request.js'
import { queryParams } from '@/composables/util'

// 商品评论管理管理-商品评论列表
export const getGoodsCommentList = (page, query = { limit: 10, keyword: '' }) => {
  let querys = queryParams(query)
  return request({
    url: `/goods_comment/${page}${querys}`,
  })
}

// 商品评论管理管理-修改商品评论状态
export const updateGoodsCommentStatus = (id, status) => {
  return request({
    url: `/goods_comment/${id}/update_status`,
    method: 'post',
    data: { status },
  })
}

// 商品评论管理管理-回复商品评价
export const reviewComment = (id, data) => {
  return request({
    url: `/goods_comment/review/${id}`,
    method: 'post',
    data: { data }
  })
}
